home *** CD-ROM | disk | FTP | other *** search
- #include <console.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unix.h>
-
- #define MAXPATH 128
-
- int brthday;
-
- char name[50];
- char tel_num[15];
- char b_day[8];
- char str_add[50];
- char cit[50];
- char state[50];
- char zip[12];
-
- FILE *fp;
-
- main()
- {
- blow();
- ask_user();
- print_stats();
- file_dump();
- thanks();
- }
-
- blow()
- {
- int i;
-
- for(i = 0; i < 12; i++) puts(" ");
- puts(" Welcome to: INFOMan!\n");
- puts(" a product of Dreamer's Software!\n\n");
- puts(" Written in Think C 5.0: GLOBAL VILLAGE BBS (512)476-0016, Austin, Tx.\n");
- for(i = 0; i < 12; i++) puts(" ");
- }
-
- ask_user()
- {
-
- printf("\n ");
- getchar();
-
- printf("\nHello, what is your name? ");
- gets(name);
-
- printf("\nWhat is your telephone number? ");
- gets(tel_num);
-
- printf("\nWhat is your birthday? ");
- gets(b_day);
-
- printf("\nStreet address: ");
- gets(str_add);
-
- printf("\nCity: ");
- gets(cit);
-
- printf("\nState: ");
- gets(state);
-
- printf("\nZip code: ");
- gets(zip);
-
- }
-
- print_stats()
- {
- printf("\n\nYour name is: %s\n", name);
- printf("Your telephone number is: %s\n", tel_num);
- printf("Your birthday is: %s\n", b_day);
- printf("Your street address is: %s\n", str_add);
- printf("Your city of residence is: %s\n", cit);
- printf("Your state of residence is: %s\n", state);
- printf("Your zip code is: %s\n", zip);
- puts("\n\n");
- printf("Is this information correct?(Y/N): ");
- if(!user_confirmed())
- {
- return(main());
- }
- else
- {
- file_dump();
- }
- }
-
- file_dump()
- {
- fp = fopen(":Validations:INFOMan" , "a+");
-
- fputs(name, fp);
- fputs(tel_num, fp);
- fputs(b_day, fp);
- fputs(str_add, fp);
- fputs(cit, fp);
- fputs(state, fp);
- fputs(zip, fp);
-
- fclose(fp);
-
- thanks();
- }
-
- thanks()
- {
- int i;
-
- for(i = 0; i < 12; i++) puts(" ");
- puts(" Thanks for using: INFOMan!");
- puts(" a product of Dreamer's Software!");
- for(i = 0; i < 12; i++) puts(" ");
-
- exec("T.W. 105:BBS:Second Sight");
- }
-
- user_confirmed()
- {
- while(1)
- {
- switch(getchar())
- {
- case 'y':
- case 'Y':
- return 1;
- case 'n':
- case 'N':
- return 0;
- default:
- break;
- }
- }
- }